<script setup>
import {
  Edit,
  Delete
} from '@element-plus/icons-vue'
import { ref } from 'vue'
const categorys = ref([
  {
    "volunteerId": 1,  //志愿时长id    int
    "studentName": "轰轰nb帅小伙",//学生姓名   string
    "studentId": 22103404, //学生id   int
    "eventDescription": "扶老奶奶过马路",//事件活动说明   string
    "startTime": "xxxx-xx-xx",//开始时间    date
    "endTime": "xxxx-xx-xx",//结束时间       date
    "volunteerTime": 111,//单次志愿时长  double
    "createTime": "2023-09-02 12:06:59",
    "updateTime": "2023-09-02 12:06:59"
  }, 
  {
    "volunteerId": 1,  //志愿时长id    int
    "studentName": "轰轰nb帅小伙",//学生姓名   string
    "studentId": 22103404, //学生id   int
    "eventDescription": "扶老爷爷过马路",//事件活动说明   string
    "startTime": "xxxx-xx-xx",//开始时间    date
    "endTime": "xxxx-xx-xx",//结束时间       date
    "volunteerTime": 666,//单次志愿时长  double
    "createTime": "2023-09-02 12:06:59",
    "updateTime": "2023-09-02 12:06:59"
  }, 
  {
    "volunteerId": 1,  //志愿时长id    int
    "studentName": "轰轰nb帅小伙",//学生姓名   string
    "studentId": 22103404, //学生id   int
    "eventDescription": "扶小孩过马路",//事件活动说明   string
    "startTime": "xxxx-xx-xx",//开始时间    date
    "endTime": "xxxx-xx-xx",//结束时间       date
    "volunteerTime": 857,//单次志愿时长  double
    "createTime": "2023-09-02 12:06:59",
    "updateTime": "2023-09-02 12:06:59"
  }, 
  {
    "volunteerId": 1,  //志愿时长id    int
    "studentName": "轰轰nb帅小伙",//学生姓名   string
    "studentId": 22103404, //学生id   int
    "eventDescription": "扶小弟弟过马路",//事件活动说明   string
    "startTime": "xxxx-xx-xx",//开始时间    date
    "endTime": "xxxx-xx-xx",//结束时间       date
    "volunteerTime": 2913,//单次志愿时长  double
    "createTime": "2023-09-02 12:06:59",
    "updateTime": "2023-09-02 12:06:59"
  }, 
])
//时长记录（学生名称，事件信息）搜索
const selectstudentname = ref('')
const selectEventDescription = ref('')
</script>

<template>
    <el-card class="page-container">
<!--    时长记录头部标题-->
    <template #header>
      <div class="header">
        <span>时长记录</span>
        <div class="extra">
          <el-button type="primary">添加时长记录</el-button>
        </div>
      </div>
    </template>
    <el-form inline>
<!--      学生id(转)姓名搜索框-->
      <el-form-item label="学生姓名：">
<!--        请选择的框-->
        <el-input v-model="selectItemName" style="width: 240px" placeholder="请输入学生姓名" />
      </el-form-item>
      <el-form-item label="事件：">
<!--        请选择的框-->
        <el-input v-model="selectItemName" style="width: 240px" placeholder="请输入事件" />
      </el-form-item>
    

<!--      搜索重置按钮-->
      <el-form-item>
        <!-- 根据条件搜索志愿时长记录 -->
        <el-button type="primary" >搜索</el-button>
        <!-- 清空并重新查询 -->
        <el-button @click="selectstudentname='' ,selectEventDescription='' ">重置</el-button>
      </el-form-item>
    </el-form>

<!--    商品列表-->
    <el-table :data="categorys" style="width: 100%">
      <el-table-column label="序号" width="100" type="index"> </el-table-column>
      <el-table-column label="学生姓名" prop="studentName"></el-table-column>
      <el-table-column label="事件活动说明" prop="eventDescription"></el-table-column>
      <el-table-column label="开始时间" prop="startTime"></el-table-column>
      <el-table-column label="结束时间" prop="endTime"></el-table-column>
      <el-table-column label="单次志愿时长" prop="volunteerTime"></el-table-column>
      <el-table-column label="操作" width="100">
        <template #default="{ row }">
          <el-button :icon="Edit" circle plain type="primary" ></el-button>
          <el-button :icon="Delete" circle plain type="danger"></el-button>
        </template>
      </el-table-column>
      <template #empty>
        <el-empty description="小时时  正在加载数据..." />
      </template>
    </el-table>
  </el-card>


</template>

<style lang="scss" scoped>
.page-container {
  min-height: 100%;
  box-sizing: border-box;

  .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}
</style>